﻿Imports System.Numerics
Imports System.Runtime.CompilerServices

Partial Class BigDecimal
#Region "Comparisions"

  Public Shared Operator <(ByVal X As BigDecimal, ByVal Y As BigDecimal) As Boolean
    If X.IsntNull Then
      If Y.IsntNull Then
        Return X.CompareTo(Y) < 0
      Else
        Throw New ArgumentNullException("<: Y is null")
      End If
    Else
      Throw New ArgumentNullException("<: X is null")
    End If
  End Operator

 Public Shared Operator >(ByVal X As BigDecimal, ByVal Y As BigDecimal) As Boolean
    If X.IsntNull Then
      If Y.IsntNull Then
        Return X.CompareTo(Y) > 0
      Else
        Throw New ArgumentNullException(">: Y is null")
      End If
    Else
      Throw New ArgumentNullException(">: X is null")
    End If
 End Operator

 Public Shared Operator <=(ByVal X As BigDecimal, ByVal Y As BigDecimal) As Boolean
    If X.IsntNull Then
      If Y.IsntNull Then
        Return X.CompareTo(Y) <= 0
      Else
        Throw New ArgumentNullException("<=: Y is null")
      End If
    Else
      Throw New ArgumentNullException("<=: X is null")
    End If
  End Operator

 Public Shared Operator >=(ByVal X As BigDecimal, ByVal Y As BigDecimal) As Boolean
    If X.IsntNull Then
      If Y.IsntNull Then
        Return X.CompareTo(Y) >= 0

      Else
        Throw New ArgumentNullException(">=: Y is null")
      End If
    Else
      Throw New ArgumentNullException(">=: X is null")
    End If
 End Operator

 Public Shared Operator =(ByVal X As BigDecimal, ByVal Y As BigDecimal) As Boolean
    If X.IsntNull Then
      If Y.IsntNull Then
        Return X.CompareTo(Y) = 0
      Else
        Throw New ArgumentNullException("=: Y is null")
      End If
    Else
      Throw New ArgumentNullException("=: X is null")
    End If
 End Operator

 Public Shared Operator <>(ByVal X As BigDecimal, ByVal Y As BigDecimal) As Boolean
    If X.IsntNull Then
      If Y.IsntNull Then
        Return X.CompareTo(Y) <> 0
      Else
        Throw New ArgumentNullException("<>: Y is null")
      End If
    Else
      Throw New ArgumentNullException("<>: X is null")
    End If
 End Operator
#End Region
End Class
